package com.feihong.txgw.inter.contract.order;

import android.content.Intent;

import com.feihong.txgw.model.bean.deliveryAdr.DeliveryAdrEntity;
import com.feihong.txgw.ui.mvp.model.IBaseModel;
import com.feihong.txgw.ui.mvp.precenter.AbBasePrecenter;
import com.feihong.txgw.ui.mvp.view.IBaseActivity;

import io.reactivex.Observable;

/**
 * @Author wangziheng
 * @ProjectName txgw_app
 * @ClassName IPlaceOrderContract
 * @package com.feihong.txgw.inter.contract.order
 * @data 2018/5/7 15:00
 * @Describe
 * @Change
 */
public interface IPlaceOrderContract {

    interface IPlaceOrderMainView extends IBaseActivity{

        void submitTerminalOrderResult(String result);

        /**
         * 计算价格
         * @return
         */
        void accountAllPrice();

        /**
         * 解析bundle 以获取地址信息和运费信息
         * @param deliveryAdrEntity
         * @return
         */
        void parseBundle(DeliveryAdrEntity deliveryAdrEntity);
    }

    interface  IPlaceOrderMainModel extends IBaseModel{
        Observable<String> submitTerminalOrder(String adrID,String type,String renark,String goodsInfo);

        Observable<DeliveryAdrEntity> parseBundle(Intent data);
    }

    abstract class AbPlaceOrderMainPrecenter extends AbBasePrecenter<IPlaceOrderMainModel,IPlaceOrderMainView>{
        public abstract void submitTerminalOrder(String adrID,String type,String renark,String goodsInfo);

        public abstract void parseBundle(Intent data);
    }
}
